$(document).ready(function(){
	$('#eat').click(function(){
		dialogBtnClick('eat');})
    $('#btn1').click(function(){
            dialogBtnClick('close');
        })    
	
	

	function dialogBtnClick(method){
        switch(method){
            case 'eat':
                food();
                break;
            case 'close':
                close_Window();
                break;
            default:
                break;
        }

    }



});
var foodimgs = ["https://s1.ax1x.com/2022/04/25/LTsyF0.jpg","https://s1.ax1x.com/2022/04/25/LTswLj.jpg","https://s1.ax1x.com/2022/04/25/LTsRlF.jpg","https://s1.ax1x.com/2022/04/25/LTsTFx.jpg","https://s1.ax1x.com/2022/04/25/LTyCff.png",
"https://s1.ax1x.com/2022/05/01/OCNMrt.jpg","https://s1.ax1x.com/2022/05/01/OCNcRJ.jpg","https://s1.ax1x.com/2022/05/01/OCNRMR.jpg","https://s1.ax1x.com/2022/05/01/OCNIIO.jpg",
"https://s1.ax1x.com/2022/05/01/OCNbzd.jpg","https://s1.ax1x.com/2022/05/01/OCNOsI.jpg","https://s1.ax1x.com/2022/05/01/OCUCWQ.jpg","https://s1.ax1x.com/2022/05/01/OCUFQs.jpg",
"https://s1.ax1x.com/2022/05/01/OCUKW4.jpg","https://s1.ax1x.com/2022/05/01/OCU3O1.jpg","https://s1.ax1x.com/2022/05/01/OCU0ld.jpg","https://s1.ax1x.com/2022/05/01/OCU2tS.jpg",
"https://s1.ax1x.com/2022/05/01/OCUhlj.jpg","https://s1.ax1x.com/2022/05/01/OCU77V.jpg","https://s1.ax1x.com/2022/05/01/OCUj1J.jpg"]
var foods = ['热干面', '胡辣汤', '菠萝包', '北京烤鸭', '薯片','可乐鸡翅','寿司','香肠','泡菜','牛排','螃蟹','意面','蛋挞','炒饭','红油抄手','葱油拌面','烧烤',
'辣子鸡','干锅鸡','红烧肉']
function food() {
    document.getElementById("tanchaung").style.display = 'block'//控制弹窗显隐
    var redomefood =Math.round(Math.random() * ((foods.length - 1) - 0) + 0)
    document.getElementById("chishenme").innerHTML = foods[redomefood]//生成随机数
    $('#foodimg').attr("src",encodeURI(foodimgs[redomefood]));
}
function close_Window() {
    document.getElementById("tanchaung").style.display = 'none'//控制弹窗显隐
}